from marajo.appengine.ext import db
from marajo.appengine.api.users import User

class Project(db.Model):
    """
    A single project
    """

    name = db.StringProperty(verbose_name="Name")
    description = db.StringProperty(verbose_name="Description")
    members = db.ListProperty(User, verbose_name="Members")

    def __str__(self):
        return self.name
    
    def has_member(self, member):
        for m in self.members:
            if member.id == m.id:
                return True
        return False
